
<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>H+ 后台主题UI框架 - 空白页</title>
    <meta name="keywords" content="">
    <meta name="description" content="">

    <link rel="shortcut icon" href="__STATIC__/layout/favicon.ico">
     <link href="__STATIC__/layout/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="__STATIC__/layout/css/font-awesome.css?v=4.4.0" rel="stylesheet">
     <!-- jqgrid-->
    <link href="__STATIC__/layout/css/animate.css" rel="stylesheet">
    <link href="__STATIC__/layout/css/style.css?v=4.1.0" rel="stylesheet">
    <link href="__STATIC__/layout/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
    <link href="__STATIC__/layout/css/gyq.css" rel="stylesheet">
    <link rel="stylesheet" href="__STATIC__/layout/css/demo.css" type="text/css">
</head>

<body style="color:#333;padding:3px;">
    <!-- 标题 -->
    <div class="page-heade">
      <h1 class="title_color">广州销路通软件有限公司-销售发货单</h1>
    </div>
    <!-- 标题 -->
    <div>
    <form action=""  class="form-inline" method="get">
     <div class="padding-10">
       <div class="form-group">
            经销商编号：<span>CU00001</span>
       </div>
       <div class="form-group text-left lr_5" style="float: right;">
            NO: <span>201711130003</span>
       </div>
     </div>
     <div class="">
        <div class="form-group">
            经销商名称：<span>南京佳和贸易有限公司</span>；送货地址：<span class="gystext">江苏省南京市鼓楼区汉口路2号楼3室</span>；联系人：<span>何先生</span>；电话：<span>13688886666</span>
        </div>
        <div class="form-group" style="float: right;">
            日期：<input type="text" class="form-control layer-date" name="" id="shipmentsDate" style="min-width: 120px;width: 120px;">
        </div>
     </div>
      <table class="row-margin-top tab-content table-bordered table text-right" border="1">
        <tr class="info">
            <th class="text-center">仓库名称</th>     
            <th class="text-center">产品名称</th>     
            <th class="text-center">规格</th>     
            <th class="text-center">单位</th>     
            <th class="text-center">出库数量</th>     
            <th class="text-center" >销售数量</th>     
            <th class="text-center" >搭赠数量</th>     
            <th class="text-center">箱价</th>     
            <th class="text-center">销售金额</th>     
            <th class="text-center">搭赠金额</th>     
            <th class="text-center">体积(立方米)</th>     
            <th class="text-center">重量(吨)</th>     
            <th class="text-center">备注</th>     
        </tr>
        <tr>
            <td class="text-left">长沙仓</td>
            <td class="text-left">04栗子咸肉粽</td>
            <td class="text-left"></td>
            <td>箱</td>
            <td class="text-right"><span>3</span>.0000</td>
            <td class="text-center"><input type="text" class="form-control" name="" id="" style="min-width: 120px;width: 120px;"></td>
            <td class="text-center"><input type="text" class="form-control" name="" id="" style="min-width: 120px;width: 120px;"></td>
            <td><span class="ObjectNum">480</span>00</td>
            <td><span class="ObjectNum">1440</span>00</td>
            <td><span class="ObjectNum">0</span>00</td>
            <td><span>0</span>.0000</td>
            <td><span>0</span>.00000000</td>
            <td><input type="text" class="form-control" name="" id=""></td>
        </tr>
        <tfoot>
            <tr class="font-bold">
                <td colspan="3" class="text-center">本页合计:</td>
                <td></td>
                <td><span>3</span>.0000</td>
                <td><span>3</span>.0000</td>
                <td><span>0</span>.0000</td>
                <td><span class="ObjectNum"></span></td>
                <td><span class="ObjectNum" id="num">1440</span>00</td>
                <td><span class="ObjectNum">0</span>00</td>
                <td><span>0</span>.0000</td>
                <td><span>0</span>.00000000</td>
                <td></td>
            </tr>
            <tr class="font-bold">
                <td colspan="3" class="text-center">实收金额(大写):</td>
                <td colspan="6" id="ChineseMoney">1440</td>
                <td colspan="4" class="text-left">元</td>
            </tr>
        </tfoot>
      </table>
   <div class="padding-10">
    制单人：<span>张三</span><span class="lr_5"></span><span class="lr_5"></span><label for="">物流公司<span class="colorRed">*</span></label>
    <select name="" id="" class="form-control">
        <option value="0">请选择</option>
    </select>；<span class="lr_5"></span>
      物流单号：<input type="text" class="form-control" name="" id="" style="min-width: 140px;width: 140px;"><span class="lr_5"></span>
    预估到货时间：<input type="text" class="form-control layer-date" name="" id="yg_dhDate"  style="min-width: 120px;width: 120px;">
   </div>

  
       <div class="text-center">
            <button class="btn btn-success" type="button">确认发货</button>
            <button class="btn btn-warning" type="button" onclick="back()">返回</button>
      </div>
</form>
    </div>
    <!-- 全局js -->
    <script src="__STATIC__/layout/js/jquery.min.js?v=2.1.4"></script>
    <script src="__STATIC__/layout/js/bootstrap.min.js?v=3.3.6"></script>
    <!-- <script src="js/plugins/metisMenu/jquery.metisMenu.js"></script> -->
    <script src="__STATIC__/layout/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
      <script src="__STATIC__/layout/js/plugins/layer/laydate/laydate.js"></script>
      <script src="__STATIC__/layout/js/plugins/sweetalert/sweetalert.min.js"></script>
      <script src="__STATIC__/layout/js/common.js"></script>
   <script>
            laydate({
                elem:"#shipmentsDate",
                event:"focus"
            })
             laydate({
                elem:"#yg_dhDate",
                event:"focus"
            })

             $(document).ready(function(){
            var $ObjectNum =$(".ObjectNum");
               toNum($ObjectNum);
                 var $gysText=$(".gystext");
                 var num =13;
                 $gysText.each(function(){
                     wordlimit($(this),num)
                 })

          })
            function wordlimit(cname,num){
　          for(var i=0;i<cname.length;i++){
　　　　　　var nowLength=cname[i].innerHTML.length;
                if(nowLength>num){
                  return cname[i].innerHTML=cname[i].innerHTML.substr(0,num)+'...'
                  }
                }
              }
   </script>
   <script>
     /*金额转化为大写*/
            var num=$("#num").text()
            // console.log(ChineseMoney)
            Arabia_To_SimplifiedChinese(num);
            var ChineseMoney = $("#ChineseMoney").html(newchar)
            // console.log(num)
      function Arabia_To_SimplifiedChinese(Num) {
    for (i = Num.length - 1; i >= 0; i--) {
        Num = Num.replace(",", "")//替换Num中的“,”
        Num = Num.replace(" ", "")//替换Num中的空格
    }    
    if (isNaN(Num)) { //验证输入的字符是否为数字
        //alert("请检查小写金额是否正确");
        return;
    }
    //字符处理完毕后开始转换，采用前后两部分分别转换
    part = String(Num).split(".");
    newchar = "";
    //小数点前进行转化
    for (i = part[0].length - 1; i >= 0; i--) {
        if (part[0].length > 10) {
            //alert("位数过大，无法计算");
            return "";
        }//若数量超过拾亿单位，提示"零","壹","贰","叁","肆","伍","陆","柒","捌","玖"
        tmpnewchar = ""
        perchar = part[0].charAt(i);
        switch (perchar) {
            case "0":  tmpnewchar = "零" + tmpnewchar;break;
            case "1": tmpnewchar = "壹" + tmpnewchar; break;
            case "2": tmpnewchar = "贰" + tmpnewchar; break;
            case "3": tmpnewchar = "叁" + tmpnewchar; break;
            case "4": tmpnewchar = "肆" + tmpnewchar; break;
            case "5": tmpnewchar = "伍" + tmpnewchar; break;
            case "6": tmpnewchar = "陆" + tmpnewchar; break;
            case "7": tmpnewchar = "柒" + tmpnewchar; break;
            case "8": tmpnewchar = "捌" + tmpnewchar; break;
            case "9": tmpnewchar = "玖" + tmpnewchar; break;
        }
        switch (part[0].length - i - 1) {
            case 0: tmpnewchar = tmpnewchar; break;
            case 1: if (perchar != 0) tmpnewchar = tmpnewchar + "拾"; break;
            case 2: if (perchar != 0) tmpnewchar = tmpnewchar + "佰"; break;
            case 3: if (perchar != 0) tmpnewchar = tmpnewchar + "仟"; break;
            case 4: tmpnewchar = tmpnewchar + "万"; break;
            case 5: if (perchar != 0) tmpnewchar = tmpnewchar + "拾"; break;
            case 6: if (perchar != 0) tmpnewchar = tmpnewchar + "佰"; break;
            case 7: if (perchar != 0) tmpnewchar = tmpnewchar + "仟"; break;
            case 8: tmpnewchar = tmpnewchar + "亿"; break;
            case 9: tmpnewchar = tmpnewchar + "拾"; break;
        }
        newchar = tmpnewchar + newchar;
    }   
    //替换所有无用汉字，直到没有此类无用的数字为止
    while (newchar.search("零零") != -1 || newchar.search("零亿") != -1 || newchar.search("亿万") != -1 || newchar.search("零万") != -1) {
        newchar = newchar.replace("零亿", "亿");
        newchar = newchar.replace("亿万", "亿");
        newchar = newchar.replace("零万", "万");
        newchar = newchar.replace("零零", "零");      
    }
    //替换以“一十”开头的，为“十”
    if (newchar.indexOf("一十") == 0) {
        newchar = newchar.substr(1);
    }
    //替换以“零”结尾的，为“”
    if (newchar.lastIndexOf("零") == newchar.length - 1) {
        newchar = newchar.substr(0, newchar.length - 1);
    }
       console.log(newchar)
    return newchar;

}
   </script>
</body>

</html>
